import React,{Component} from "react";

import "../css/header.css";
import {connect} from "react-redux";

class Headers extends Component{
	render(){
		return (
			<header>
				<div className="header_left" onClick={this.props.toggle.bind(this)}>
					<i className="iconfont">&#xe60d;</i>
					<span>{this.props.title}</span>
				</div>
				<div className="header_right">
					<span>深圳<em className="iconfont">&#xe6c8;</em></span>
					<i className="iconfont">&#xe6c9;</i>
				</div>
			</header>
		)
	}
}

var Header = connect(
	function(state,ownprops){
		return {
			title:state.headerTitle
		}
	},
	function(dispatch,ownprops){
		return {
			toggle:function(){
				dispatch({
					type:"ASIDE_TOGGLE"
				})
			}
		}
	}
)(Headers);

export default Header;
